Skip to content

Conversation

kolluria
Copy link
Contributor

@kolluria kolluria commented Oct 8, 2025

What this PR does / why we need it:

As part of #3633, I introduced a change to VirtualMachineSnapshot reconciler which is incomplete as the Application Builder doesn't know which resource of watch over. This has resulted in the following error -

{"level":"error","time":"2025-10-08T13:01:41.495645677Z","caller":"virtualmachinesnapshot/virtualmachinesnapshot_controller.go:169","msg":"Failed to build application controller. Err: there are no watches configured, controller will never get triggered. Use For(), Owns(), Watches() or WatchesRawSource() to set them up","TraceId":"6de5ab60-5dd1-4a60-89fb-cc2706b80620","stacktrace":"sigs.k8s.io/vsphere-csi-driver/v3/pkg/syncer/cnsoperator/controller/virtualmachinesnapshot.add\n\t/Users/vsatyanaraya/src/github.com/vsphere-csi-driver/pkg/syncer/cnsoperator/controller/virtualmachinesnapshot/virtualmachinesnapshot_controller.go:169\nsigs.k8s.io/vsphere-csi-driver/v3/pkg/syncer/cnsoperator/controller/virtualmachinesnapshot.Add\n\t/Users/vsatyanaraya/src/github.com/vsphere-csi-driver/pkg/syncer/cnsoperator/controller/virtualmachinesnapshot/virtualmachinesnapshot_controller.go:139\nsigs.k8s.io/vsphere-csi-driver/v3/pkg/syncer/cnsoperator/controller.AddToManager\n\t/Users/vsatyanaraya/src/github.com/vsphere-csi-driver/pkg/syncer/cnsoperator/controller/controller.go:34\nsigs.k8s.io/vsphere-csi-driver/v3/pkg/syncer/cnsoperator/manager.InitCnsOperator\n\t/Users/vsatyanaraya/src/github.com/vsphere-csi-driver/pkg/syncer/cnsoperator/manager/init.go:309\nmain.main.initSyncerComponents.func9.3\n\t/Users/vsatyanaraya/src/github.com/vsphere-csi-driver/cmd/syncer/main.go:374"}
{"level":"error","time":"2025-10-08T13:01:41.495705398Z","caller":"manager/init.go:310","msg":"failed to setup the controller for Cns operator. Err: there are no watches configured, controller will never get triggered. Use For(), Owns(), Watches() or WatchesRawSource() to set them up","TraceId":"cbdf050f-80dc-4d4a-ad2e-6f7094b832a0","stacktrace":"sigs.k8s.io/vsphere-csi-driver/v3/pkg/syncer/cnsoperator/manager.InitCnsOperator\n\t/Users/vsatyanaraya/src/github.com/vsphere-csi-driver/pkg/syncer/cnsoperator/manager/init.go:310\nmain.main.initSyncerComponents.func9.3\n\t/Users/vsatyanaraya/src/github.com/vsphere-csi-driver/cmd/syncer/main.go:374"}
{"level":"error","time":"2025-10-08T13:01:41.495728798Z","caller":"syncer/main.go:375","msg":"Error initializing Cns Operator. Error: there are no watches configured, controller will never get triggered. Use For(), Owns(), Watches() or WatchesRawSource() to set them up","TraceId":"aad233d1-1321-42c0-8ce1-1dcc75959448","stacktrace":"main.main.initSyncerComponents.func9.3\n\t/Users/vsatyanaraya/src/github.com/vsphere-csi-driver/cmd/syncer/main.go:375"}

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #3633

Testing done:

  1. Verified that the initialisation is successful
{"level":"info","time":"2025-10-08T13:06:14.157279212Z","caller":"virtualmachinesnapshot/virtualmachinesnapshot_controller.go:101","msg":"Creating CnsVolumeInfo Service to persist mapping for VolumeID to storage policy info","TraceId":"63c44ee9-e946-40a9-aa38-15e050d361fc"}
{"level":"info","time":"2025-10-08T13:06:14.157430217Z","caller":"virtualmachinesnapshot/virtualmachinesnapshot_controller.go:106","msg":"Successfully initialized VolumeInfoService","TraceId":"63c44ee9-e946-40a9-aa38-15e050d361fc"}
{"level":"info","time":"2025-10-08T13:06:14.16152821Z","caller":"controller/controller.go:175","msg":"Starting EventSource","TraceId":"4108880a-fc08-4cfa-ac0e-1ad2b766c3d8","controller":"virtualmachinesnapshot-controller","controllerGroup":"vmoperator.vmware.com","controllerKind":"VirtualMachineSnapshot","source":"kind source: *v1alpha5.VirtualMachineSnapshot"}
{"level":"info","time":"2025-10-08T13:06:14.16158917Z","caller":"controller/controller.go:183","msg":"Starting Controller","TraceId":"4108880a-fc08-4cfa-ac0e-1ad2b766c3d8","controller":"virtualmachinesnapshot-controller","controllerGroup":"vmoperator.vmware.com","controllerKind":"VirtualMachineSnapshot"}
{"level":"info","time":"2025-10-08T13:06:14.374846436Z","caller":"controller/controller.go:217","msg":"Starting workers","TraceId":"4108880a-fc08-4cfa-ac0e-1ad2b766c3d8","controller":"virtualmachinesnapshot-controller","controllerGroup":"vmoperator.vmware.com","controllerKind":"VirtualMachineSnapshot","worker count":10}
  1. Created a VolumeSnapshot to verify that the reconciler is able to process the request
{"level":"info","time":"2025-10-08T13:11:26.719013996Z","caller":"virtualmachinesnapshot/virtualmachinesnapshot_controller.go:205","msg":"Reconcile Started for VirtualMachineSnapshot vm-snapshot/sample-vm-1-snapshot","TraceId":"bd48410e-ae27-4c7b-a07f-e892a26dbb18"}
{"level":"info","time":"2025-10-08T13:11:26.719687579Z","caller":"virtualmachinesnapshot/virtualmachinesnapshot_controller.go:234","msg":"Reconciling virtualmachinesnapshot vm-snapshot/sample-vm-1-snapshot","TraceId":"bd48410e-ae27-4c7b-a07f-e892a26dbb18"}
{"level":"info","time":"2025-10-08T13:11:26.71981721Z","caller":"virtualmachinesnapshot/virtualmachinesnapshot_controller.go:261","msg":"reconcileNormal: Adding finalizer cns.vmware.com/syncvolume on virtualmachinesnapshot cr vm-snapshot/sample-vm-1-snapshot","TraceId":"bd48410e-ae27-4c7b-a07f-e892a26dbb18"}
{"level":"info","time":"2025-10-08T13:11:26.752560424Z","caller":"virtualmachinesnapshot/virtualmachinesnapshot_controller.go:251","msg":"Successfully successfully processed vmsnapshot vm-snapshot/sample-vm-1-snapshot","TraceId":"bd48410e-ae27-4c7b-a07f-e892a26dbb18"}
{"level":"info","time":"2025-10-08T13:11:26.754216215Z","caller":"virtualmachinesnapshot/virtualmachinesnapshot_controller.go:207","msg":"Reconcile Completed for virtualmachinesnapshot vm-snapshot/sample-vm-1-snapshot Time Taken 35.168075ms","TraceId":"bd48410e-ae27-4c7b-a07f-e892a26dbb18"}

Special notes for your reviewer:

Release note:

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 8, 2025
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 8, 2025
@kolluria
Copy link
Contributor Author

kolluria commented Oct 8, 2025

/cc @deepakkinni
/assign @kolluria
/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Oct 8, 2025
@deepakkinni
Copy link
Collaborator

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deepakkinni, kolluria

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [deepakkinni,kolluria]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kolluria
Copy link
Contributor Author

kolluria commented Oct 8, 2025

ok-to-test-wcp
ok-to-test-tkg

@kolluria
Copy link
Contributor Author

kolluria commented Oct 8, 2025

VKS Precheckin pipeline - #467

Ran 6 of 1840 Specs
SUCCESS! -- 6 Passed | 0 Failed | 0 Pending | 1834 Skipped | 0 Flaked

WCP Precheckin pipeline - #445

Ran 14 of 1840 Specs
SUCCESS! -- 14 Passed | 0 Failed | 0 Pending | 1826 Skipped | 0 Flaked

@deepakkinni
Copy link
Collaborator

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 8, 2025
@deepakkinni
Copy link
Collaborator

/retest

@k8s-ci-robot k8s-ci-robot merged commit cba0a02 into kubernetes-sigs:master Oct 8, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants